Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Create allow/deny matcher with Patterns, Regex and Functions
Install using npm or yarn:
npm i allowlist
# or
yarn add allowlist
Import:
// CommonJS
const { allowlist } = require('allowlist')
// ESM
import { allowlist } from 'allowlist'
Note: You may need to transpile library!
Create a matcher:
// Allow a good string
const allow = allowlist('good')
// Allow a good string ignore case
const allow = allowlist('good', true)
// Allow a better regex
const allow = allowlist(/better/)
// Allow list of good values
const allow = allowlist([
'good',
/better/,
/best/i
])
// Allow good values with your logic
const allow = allowlist((value) => {
return value.includes('good')
})
// Deny bad values
const allow = allowlist({
reject: [
'bad',
/awful/,
/worse/i
]
})
// Allow good values and deny bads
const allow = allowlist({
accept: [
'good',
/better/,
/best/i
],
reject: [
'bad',
/awful/,
/worse/i
]
})
Use matcher:
if (allow('Sometimes good things fall apart so better things can fall together.')) {
// cool stuff
}
MIT. Made with 💖
FAQs
Create allow/deny matcher with Patterns, Regex and Functions
We found that allowlist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.